package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.query.InHospitalApplyNoQuery;
import com.mk.admin.model.query.InHospitalRegisterQuery;
import com.mk.admin.model.vo.InHospitalRegisterVo;
import com.mk.admin.service.InHospitalRegisterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/inHospitalRegister")
@Api(tags = "住院登记")
public class InHospitalRegisterController {
    @Autowired
    private InHospitalRegisterService inHospitalRegisterService;

    @PostMapping("/inHospitalApplyNo")
    @ApiOperation("查询入院申请单")
    public ResultDto inHospitalApplyNo(@RequestBody InHospitalApplyNoQuery query) {
        return null;
    }

    @PostMapping("/select")
    public ResultDto select(@RequestBody InHospitalRegisterQuery inHospitalRegisterQuery) {
        return inHospitalRegisterService.select(inHospitalRegisterQuery);
    }

    @PostMapping("/add")
    public ResultDto add(@RequestBody InHospitalRegisterVo inHospitalRegisterVo) {
        return inHospitalRegisterService.add(inHospitalRegisterVo);
    }

    @PostMapping("/update")
    public ResultDto update(@RequestBody InHospitalRegisterVo inHospitalRegisterVo) {
        return inHospitalRegisterService.update(inHospitalRegisterVo);
    }

    @PostMapping("/delete")
    public ResultDto delete(@RequestBody InHospitalRegisterVo inHospitalRegisterVo) {
        return inHospitalRegisterService.delete(inHospitalRegisterVo.getId());
    }

    @PostMapping("/status")
    public ResultDto status(@RequestBody InHospitalRegisterVo inHospitalRegisterVo) {
        return inHospitalRegisterService.status(inHospitalRegisterVo.getId());
    }
}
